<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
</html>

<script>
    function Person() {
        return {
            get: function (obj) {
                this.title = obj.title;
                this.mask = obj.mask;
                var that = this;
                setTimeout(function () {
                    var data = "调用成功----";
                    if (obj.success instanceof Function) {
                        obj.success(data + 'title:' + that.title + ',mask:' + that.mask);
                    }
                }, 1000);
            },
            post:function (str) {
                console.log('this is post method!'+str);
            }
        }
    }

    var p = new Person();
    p.get({
        title: '这是传递过去的标题',
        mask: true,
        success: function (res) {
            console.log(res);
        }
    });

    p.post('12346');
</script>